/**
 * Copyright 2015 ABSir's Studio
 * 
 * All right reserved
 *
 * Create on 2015年4月13日 下午2:31:03
 */
package com.absir.appserv.master.bean;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.absir.appserv.feature.menu.value.MaEntity;
import com.absir.appserv.feature.menu.value.MaMenu;
import com.absir.appserv.system.bean.base.JbBean;
import com.absir.appserv.system.bean.value.JaEdit;
import com.absir.appserv.system.bean.value.JaLang;
import com.absir.appserv.system.bean.value.JeEditable;
import com.absir.orm.value.JaColum;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * @author absir
 *
 */
@MaEntity(parent = { @MaMenu("节点管理") }, name = "服务", value = @MaMenu(order = -2))
@Entity
public class JSlaveServer extends JbBean {

	@JaLang("服务器名称")
	private String name;

	@JaLang("主机")
	@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
	@ManyToOne
	private JSlave host;

	@JaLang("端口号")
	@JaEdit(groups = JaEdit.GROUP_LIST)
	private int port;

	@JaLang(value = "IP")
	@JaEdit(groups = JaEdit.GROUP_LIST)
	private String ip;

	@JaLang("服务IP")
	@JsonIgnore
	@JaEdit(groups = JaEdit.GROUP_LIST)
	private String serverIP;

	@JaLang("开始时间")
	@JaEdit(groups = JaEdit.GROUP_LIST, types = "dateTime")
	private long beginTime;

	@JaLang("关闭时间")
	@JaEdit(groups = JaEdit.GROUP_LIST, types = "dateTime")
	private long passTime;

	@JaLang("更新时间")
	@JaEdit(groups = JaEdit.GROUP_LIST, types = "dateTime", editable = JeEditable.LOCKED)
	private long updateTime;

	@JaLang("已经同步")
	@JaEdit(groups = JaEdit.GROUP_LIST, editable = JeEditable.LOCKED)
	@JaColum(indexs = @Index(columnList = "synched"))
	private boolean synched;

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the host
	 */
	public JSlave getHost() {
		return host;
	}

	/**
	 * @param host
	 *            the host to set
	 */
	public void setHost(JSlave host) {
		this.host = host;
	}

	/**
	 * @return the port
	 */
	public int getPort() {
		return port;
	}

	/**
	 * @param port
	 *            the port to set
	 */
	public void setPort(int port) {
		this.port = port;
	}

	/**
	 * @return the ip
	 */
	public String getIp() {
		return ip;
	}

	/**
	 * @param ip
	 *            the ip to set
	 */
	public void setIp(String ip) {
		this.ip = ip;
	}

	/**
	 * @return the serverIP
	 */
	public String getServerIP() {
		return serverIP;
	}

	/**
	 * @param serverIP
	 *            the serverIP to set
	 */
	public void setServerIP(String serverIP) {
		this.serverIP = serverIP;
	}

	/**
	 * @return the beginTime
	 */
	public long getBeginTime() {
		return beginTime;
	}

	/**
	 * @param beginTime
	 *            the beginTime to set
	 */
	public void setBeginTime(long beginTime) {
		this.beginTime = beginTime;
	}

	/**
	 * @return the passTime
	 */
	public long getPassTime() {
		return passTime;
	}

	/**
	 * @param passTime
	 *            the passTime to set
	 */
	public void setPassTime(long passTime) {
		this.passTime = passTime;
	}

	/**
	 * @return the updateTime
	 */
	public long getUpdateTime() {
		return updateTime;
	}

	/**
	 * @param updateTime
	 *            the updateTime to set
	 */
	public void setUpdateTime(long updateTime) {
		this.updateTime = updateTime;
	}

	/**
	 * @return the synched
	 */
	public boolean isSynched() {
		return synched;
	}

	/**
	 * @param synched
	 *            the synched to set
	 */
	public void setSynched(boolean synched) {
		this.synched = synched;
	}
}
